package xmlnode

import (
	

	
)

//XMLNode will represent an attribute, character data, comment, or processing instruction node
type XMLNode struct {
	xml.Token
	tree.NodePos
	tree.NodeType
	Parent tree.Elem
}

//GetToken returns the xml.Token representation of the node
func ( XMLNode) () xml.Token {
	if .NodeType == tree.NtAttr {
		 := .Token.(*xml.Attr)
		return *
	}
	return .Token
}

//GetParent returns the parent node
func ( XMLNode) () tree.Elem {
	return .Parent
}

//ResValue returns the string value of the attribute
func ( XMLNode) () string {
	switch .NodeType {
	case tree.NtAttr:
		return .Token.(*xml.Attr).Value
	case tree.NtChd:
		return string(.Token.(xml.CharData))
	case tree.NtComm:
		return string(.Token.(xml.Comment))
	}
	//case tree.NtPi:
	return string(.Token.(xml.ProcInst).Inst)
}